/**
 * 
 */
package com.shiplanet.dao.impl;

import java.util.List;

import org.hibernate.criterion.Example;
import org.springframework.stereotype.Repository;

import com.shiplanet.dao.UserDAO;
import com.shiplanet.dao.impl.BaseDAOImpl;
import com.shiplanet.entity.User;

/**
 * @author joesong
 *
 */
@Repository("userDAO")
public class UserDAOImpl extends BaseDAOImpl<User> implements UserDAO {

	@SuppressWarnings("unchecked")
	public List<User> findUsersByExample(User user) {
		Example example = Example.create(user).ignoreCase().enableLike();
		return getCurrentSession().createCriteria(User.class).add(example)
				.list();
	}

}
